-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Performance fix the analytics_collect_data cron job long run #40463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.4-develop
Are you sure you want to change the base?
Conversation
|
Hi @AlexRapatij. Thank you for your contribution!
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
|
@magento run all tests |
|
@AlexRapatij Thank you for your contribution. There is a test related to this limit value: the |
|
@magento run all tests |
|
@magento run Unit Tests, Functional Tests EE, Functional Tests CE, Functional Tests B2B, Database Compare |
Description (*)
For a fairly large database, the
analytics_collect_datacron job takes too long to execute. For one real example project, it took last time ~36 hours.According to the investigation, the reason for that is the validation of the report definition query. By adding a limit of 0, it turns into a final SQL-query without any limits at all. As a result, there is a loading of all tables data.
The solution is super simple - to add a limit equal to 1 to the validation query
Manual testing scenarios (*)
query(line 55). Unfortunately, thebin/magento dev:query-log:enabledoesn't log such queries.analytics_collect_datacron jobgrep 'Report validation query' var/log/system.logExamples
Before change
There is queries, before the change was applied
After
After the limitation was added
Contribution checklist (*)